-
Couldn't load subscription status.
- Fork 234
Mark test_binstats_quantile as xfail in the GMT Legacy Tests workflow #4087
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pygmt/tests/test_binstats.py
Outdated
| if Version(__gmt_version__) > Version("6.4.0"): | ||
| npt.assert_allclose(temp_grid.min(), 53) | ||
| npt.assert_allclose(temp_grid.median(), 543664.5) | ||
| npt.assert_allclose(temp_grid.mean(), 1661363.6) | ||
| else: # TODO(GMT>=6.5.0): Remove if-condition with different min/median/mean values | ||
| npt.assert_allclose(temp_grid.min(), 0) | ||
| npt.assert_allclose(temp_grid.median(), 330700.0) | ||
| npt.assert_allclose(temp_grid.mean(), 1459889.1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unsure which values are the correct ones. Do we want to check in upstream GMT on what might have changed binstat from GMT 6.4 to 6.5?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likely related to GenericMappingTools/gmt#8243.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the reminder, forgot about that thread! Have changed to an xfail in commit 1dc2e42
This reverts commit b37898b.
Description of proposed changes
The
test_binstats_quantiletest (introduced in #3012) is failing on the legacy CI tests.Trying to see if it's due to xarray/pandas/numpy or using old version of GMT 6.4Edit: seems to be that GMT 6.4 gives different results to GMT 6.5+, most likely due to changes in GenericMappingTools/gmt#8243Traceback from https://github.com/GenericMappingTools/pygmt/actions/runs/16895808645/job/47865247702#step:6:1098
___________________________ test_binstats_quantile ____________________________ def test_binstats_quantile(): """ Test binstats quantile statistic functionality. """ temp_grid = binstats( data="@capitals.gmt", spacing=5, statistic="quantile", quantile_value=75, search_radius="1000k", aspatial="2=population", region="g", ) assert temp_grid.dims == ("y", "x") assert temp_grid.gmt.gtype is GridType.CARTESIAN assert temp_grid.gmt.registration is GridRegistration.GRIDLINE npt.assert_allclose(temp_grid.max(), 15047685) > npt.assert_allclose(temp_grid.min(), 53) ..\pygmt\tests\test_binstats.py:71: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (<function assert_allclose.<locals>.compare at 0x000001D761A02E80>, array(0., dtype=float32), array(53)) kwds = {'equal_nan': True, 'err_msg': '', 'header': 'Not equal to tolerance rtol=1e-07, atol=0', 'verbose': True} @wraps(func) def inner(*args, **kwds): with self._recreate_cm(): > return func(*args, **kwds) E AssertionError: E Not equal to tolerance rtol=1e-07, atol=0 E E Mismatched elements: 1 / 1 (100%) E Max absolute difference: 53. E Max relative difference: 1. E x: array(0., dtype=float32) E y: array(53) C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\contextlib.py:81: AssertionErrorOutput of pygmt.show_versions() from CI:
Patches #3012
Preview:
Reminders
make formatandmake checkto make sure the code follows the style guide.doc/api/index.rst.Slash Commands
You can write slash commands (
/command) in the first line of a comment to performspecific operations. Supported slash command is:
/format: automatically format and lint the code